UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/LqBnpaet0baBSDLY+cvhbvT7WtTqNlghiPpjlePZg8='
WHERE
key_id = '3a88e590a4670bda00d072eee6be2545dff99ffaaba73730cf6458489bb1af10'
AND (
token = '/LqBnpaet0baBSDLY+cvhbvT7WtTqNlghiPpjlePZg8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)