UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BDt+KH1JUBUIMc3aBx2GR1R7xyOgmojwCTzmtYxledQ='
WHERE
key_id = '37195dd7e5886197824fe90513f19f4de1ae8b5ad320726b149c37e8d60101b9'
AND (
token = 'BDt+KH1JUBUIMc3aBx2GR1R7xyOgmojwCTzmtYxledQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)