UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dLlvUhFOh1fW5rpryGgBQJfM2wL6u2Aed1BXjFnMxlc='
WHERE
key_id = 'd935bdf65237bb370818a24c6bec1e85b9da084bcba8cce26e657fbe4a5e7ab2'
AND (
token = 'dLlvUhFOh1fW5rpryGgBQJfM2wL6u2Aed1BXjFnMxlc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)