UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/EdbkNPm+KTN7bbgINwZKv8SP9FKyC9lTx3Q6Zkasvc='
WHERE
key_id = 'b5a7343fe44fb423b3f0e2501ef2973bdad5913d1488337da4e87a75b98c467c'
AND (
token = '/EdbkNPm+KTN7bbgINwZKv8SP9FKyC9lTx3Q6Zkasvc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)