UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UyIxGZXM+n3DxbsX8lZESIMW2kYHKdfEkvjfmEsmHHg='
WHERE
key_id = 'eb178d895b50ed007cfaf552eec1bd03d4e375b67a81ca1a1651eb3ac9369ec9'
AND (
token = 'UyIxGZXM+n3DxbsX8lZESIMW2kYHKdfEkvjfmEsmHHg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)