UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5e4/ydyu/gcp/d8o5IUvebU6AAfxTV4FLpXphGXAsQo=' 
WHERE 
  key_id = 'cdca91817b442935bcd39c2ed1c6bcde64bd7b37872b6e5f29a2a226095b47cf' 
  AND (
    token = '5e4/ydyu/gcp/d8o5IUvebU6AAfxTV4FLpXphGXAsQo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023