UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/2omcHbguNXI93lNWHz9rFgximzci5i/lVS0lJjyf3g='
WHERE
key_id = 'aa0e809e2643aa798587782528b833066311c3ec0e9a499fe919ddb7ac89c5eb'
AND (
token = '/2omcHbguNXI93lNWHz9rFgximzci5i/lVS0lJjyf3g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)