UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NxfZ9oW+dtFroatJQ9PeYHjSShRp6XHOc8EbVg70gd8='
WHERE
key_id = '4d8767f17a24b160d8721619b4656aef929ff7115abf8436a8cd641eac2d51c0'
AND (
token = 'NxfZ9oW+dtFroatJQ9PeYHjSShRp6XHOc8EbVg70gd8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)