UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DtfuBPkhY+A3iQPRo42XCE/TOOQtdaSrW2qi1CoQvuA='
WHERE
key_id = '55b09c5bcd8efac356b016ad43edc98fdef1465596357dff3dae3430137a0dc7'
AND (
token = 'DtfuBPkhY+A3iQPRo42XCE/TOOQtdaSrW2qi1CoQvuA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)