UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'N25uhWOaiNt7X7kU3ScdIJ7I9qfOyoo91kATIshZ87o='
WHERE
key_id = '076b5c8b340f3b2eade5fcad37d24263aa2f324ce6d9814c8f3149c9ac590b92'
AND (
token = 'N25uhWOaiNt7X7kU3ScdIJ7I9qfOyoo91kATIshZ87o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)