UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'h7tPoht4LeEjIJA/H4zWYI1isAMCVBu2DNFQnqMVJYA='
WHERE
key_id = 'adeca232ade5a8463330ae85261c478f72951b60b74533d23127827f1c1b92d7'
AND (
token = 'h7tPoht4LeEjIJA/H4zWYI1isAMCVBu2DNFQnqMVJYA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)