UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hqhxY75TcJtM3OGd4k1OKIRTJiMeyvhOpdgR8YxaNdQ='
WHERE
key_id = '66c6aa01a73c12f20cc0d58a67a8d976d65adf7146e8e7b594c239f2e6b604a9'
AND (
token = 'hqhxY75TcJtM3OGd4k1OKIRTJiMeyvhOpdgR8YxaNdQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)