UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jH4wFL0xpYANRgTCoUle02WkXF0F6GikALr44LnovMc=' 
WHERE 
  key_id = '80cec0cf9396fe6e5cd46c73c66996ee8c4163580e072747b45f7dc80f7fc0a0' 
  AND (
    token = 'jH4wFL0xpYANRgTCoUle02WkXF0F6GikALr44LnovMc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038