UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DgkbppEmwKxGNNrQBNYqYUtMNyWkYnvW+S++FJZpHMA='
WHERE
key_id = 'ff475c1b4c2dfe4c1a8b655bdf9e023e19b6b139b9b39e820abc7d523c2b8eae'
AND (
token = 'DgkbppEmwKxGNNrQBNYqYUtMNyWkYnvW+S++FJZpHMA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)