UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'e2Oe+msCNEiwnNiDlXsS3/hFtWHVW0RXja82Kc3euDk='
WHERE
key_id = '1866159813b0cc1c0751b420b259a978fd1d078f43f2caca2da6ef096737b44b'
AND (
token = 'e2Oe+msCNEiwnNiDlXsS3/hFtWHVW0RXja82Kc3euDk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)