UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QHdAjO6hTss/eXPand52rA9fvBeH8GlHy8V5PMVU1OA='
WHERE
key_id = 'a5a65efbc63ed2df961db87d4870de19546c1781cec89bb2649ae9368a193776'
AND (
token = 'QHdAjO6hTss/eXPand52rA9fvBeH8GlHy8V5PMVU1OA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)