UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2mAHmvUidjw6Ed7dtWkuiKSPm6pxbvsn3bqde3G+gTY='
WHERE
key_id = 'fb0e841d7eaa2e962c46166869b1a99c0a8864c27c69a98391c82528d6b68b80'
AND (
token = '2mAHmvUidjw6Ed7dtWkuiKSPm6pxbvsn3bqde3G+gTY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)