UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ib3072Z9igU33ZwFay7qfcsXO+M8HZyEt3jIoaqKWSE='
WHERE
key_id = '994eb13c922ecb916fd53140c7a8509f7797b548742cf35b9c5d61b5e41ccf77'
AND (
token = 'ib3072Z9igU33ZwFay7qfcsXO+M8HZyEt3jIoaqKWSE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)