UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2PaXUDMpJcXTXWhuvtd7t6x1yhHzeRjwb0aDCaX1J8I='
WHERE
key_id = '82b3a030fdb18ea6187823a644ab880d81970bca929b34cb13175088865f3179'
AND (
token = '2PaXUDMpJcXTXWhuvtd7t6x1yhHzeRjwb0aDCaX1J8I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)