UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Op9/3eUz91biOMBa0hsNPHwaOyBRME2OO5rFIzi1kuQ=' 
WHERE 
  key_id = '38c0b2d89394231ac7935bfc18a417644aaff9496fe091f29e1824b1781fdb46' 
  AND (
    token = 'Op9/3eUz91biOMBa0hsNPHwaOyBRME2OO5rFIzi1kuQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036