UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '05pWUGlb6plBILiG79LEemiDpzOOrTiNVudUiJ96Wv8='
WHERE
key_id = 'ff398d328b67e713490af8c453ec4727ebd1db22a2996444d26a9145007dfecc'
AND (
token = '05pWUGlb6plBILiG79LEemiDpzOOrTiNVudUiJ96Wv8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)