UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oNigGvqMANjMlI6z2kqGF/BRhTPTEevDuDPXLak4kKo=' 
WHERE 
  key_id = '20ad094e7f52f2d3a0faa2964eb39288b19bbe12c2b2fec2f3f1b04184e337a6' 
  AND (
    token = 'oNigGvqMANjMlI6z2kqGF/BRhTPTEevDuDPXLak4kKo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00013