UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oPfjY7ItKvNXixE+C0cmbCeX1urWWRNx4cFUmnqry5s='
WHERE
key_id = '7a2947b9b31f7f625df3369cc0003d96380fdaea1a5ae21f7b57705ee7926056'
AND (
token = 'oPfjY7ItKvNXixE+C0cmbCeX1urWWRNx4cFUmnqry5s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)