UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1stvFA2ABn8SrRBjkgv7+LwuBUL/cEPB+9stMiHGQTk='
WHERE
key_id = '2b905f18186e8db2523b7cf98086ac881404d8c439dcc4af30d2da029ca2818e'
AND (
token = '1stvFA2ABn8SrRBjkgv7+LwuBUL/cEPB+9stMiHGQTk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)