UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'C5/99Hui2H0d5v9rJSXZFU2TYdAB6jGxBo80w0pLvwA='
WHERE
key_id = '6b97b12e3903806ab347ea4254ef9aede5ded751916914613f95108390b3edbe'
AND (
token = 'C5/99Hui2H0d5v9rJSXZFU2TYdAB6jGxBo80w0pLvwA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)