UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'D159McCvCKgMDGJj7OL3IZH6uKVkk8OpQsLWn1AcFuo=' 
WHERE 
  key_id = '8d4af2dbe61d2e6ed8ea651375b0c7e5c9c10bd63941fee3224a8a461ffae7c0' 
  AND (
    token = 'D159McCvCKgMDGJj7OL3IZH6uKVkk8OpQsLWn1AcFuo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027