UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'w2ABZtzD67DJ5x9vRYFWw3CXfbcpBgtVOqdif4pikLA='
WHERE
key_id = '8a4353217416ee37ba7d5024e015e66e2550a1ef2098e3b09b4264d5be4c0b1c'
AND (
token = 'w2ABZtzD67DJ5x9vRYFWw3CXfbcpBgtVOqdif4pikLA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)