UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'F5a1ewSr3oqgZc6HLR0MXLQqLoXqjfPtnw7EFz4WHZA=' 
WHERE 
  key_id = 'e06e93c5585684d59623785fba1b4b60e116015cc709c5a07015dd63667a79df' 
  AND (
    token = 'F5a1ewSr3oqgZc6HLR0MXLQqLoXqjfPtnw7EFz4WHZA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055