UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5GSTVDlKP2kdj+z40BYGiScX3HUXB8uZDYdFuiZWb98='
WHERE
key_id = '749720081101f320ab2f57a3293abb433ff372419d56dfb79826c42202620d99'
AND (
token = '5GSTVDlKP2kdj+z40BYGiScX3HUXB8uZDYdFuiZWb98='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)