UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hFEic5u/AYSd1RBT1ZlL+iL8PQEiL1+t6ezMkWH+rdI='
WHERE
key_id = 'bd98a47a225dac9604d278ae8465075575a3062ce9c5380a4504a97fe1438e15'
AND (
token = 'hFEic5u/AYSd1RBT1ZlL+iL8PQEiL1+t6ezMkWH+rdI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)