UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '227OTpVEr0o+QQXAP4Hx4xFKZH27QoCd8zBQ8V0GCvg=' 
WHERE 
  key_id = 'cea6b41e3e7e34e44971b48c1c62e34dce4355009b23aefd81c1bc77f59913e6' 
  AND (
    token = '227OTpVEr0o+QQXAP4Hx4xFKZH27QoCd8zBQ8V0GCvg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031