UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'c2gHkkH4VVHuwRqvVhCx+Zx5qUMak2Kkr5ZBwCwDQF0='
WHERE
key_id = 'c147e3de5eb135b68716fa200895c5bd9ee86d1e529a9fa76116ee7434f725aa'
AND (
token = 'c2gHkkH4VVHuwRqvVhCx+Zx5qUMak2Kkr5ZBwCwDQF0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)